import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import "bootstrap/dist/css/bootstrap.css"
import "./assets/fonts/iconfont.css"
import VueRouter from 'vue-router'
import MyTabBar from '@/components/MyTabBar'
import MyGoodsList from '@/第七天作业/练习3/MyGoodsList'
import MyGoodsSearch from '@/第七天作业/练习3/MyGoodsSearch'
import MyUserInfo from '@/第七天作业/练习3/MyUserInfo'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect: '/mygoodslist',
  },
  {
   path:'/mygoodslist',
   name: 'MyGoodsList',
   component:MyGoodsList,
   meta:{
    index:0
   }
  },
  {
   path:'/mygoodssearch',
   name: 'MyGoodsSearch',
   component:MyGoodsSearch,
   meta:{
    index:1
   }
  },
  {
   path:'/mygoodsinfo',
   name: 'MyUserInfo',
   component:MyUserInfo,
   meta:{
    index:3
   }
  }
]

const router = new VueRouter({
   routes
})

axios.defaults.baseURL = 'https://www.escook.cn'
Vue.prototype.$axios = axios
// 全局指令
Vue.directive("focus", {
  inserted(el){
    el.focus()
  }
})

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
